
<extend name="Index:base" />
	<block name="content">

				<!-- 中间部分开始 -->
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<!-- 面包屑导航 -->
						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="__APP__/admin/index">首页</a>
							</li>
							<li class="active">会员等级</li>
						</ul><!-- .breadcrumb -->

					</div>

					<div class="page-content">

						<!-- 页面导航 -->
						<div class="page-header">
							<h1>
								会员等级
								<small>
									<i class="icon-double-angle-right"></i>
									 查看
								</small>
							</h1>
						</div>

						<div class="row">
							<div class="col-xs-12">
										<!--<div>
										<form action="__CONTROLLER__/search" method="post" style="margin-bottom:5px;">
										<input type="text" class="user_search" required placeholder="Search" name="uname" style="height:30px;margin-top:5px;">
										<input type="submit" value="搜索" style="height:30px;margin-top:-4px;" class="btn btn-xs">
										<a href="__CONTROLLER__/insert" class="btn btn-primary"><small><i class="icon-plus-sign bigger-125"></i> 添加友情链接</small></a>
										</form>

										</div>-->
										<!--搜索-->
				<div class="row" style="padding:0px;height:auto;overflow:hidden;margin-bottom:10px;">
                                <div class="col-xs-12 col-sm-8">
                                <a class="btn btn-primary pull-left" style="padding:1px 10px;" href="__CONTROLLER__/insert">
                                    <i class="icon-plus-sign bigger-125"></i>
                                    添加会员等级
                                </a>
                            </div>
                            <div class="col-xs-12 col-sm-4">
                                <form action="__CONTROLLER__/search" method="post">
                                    <div class="input-group pull-right">
                                        <input class="form-control search-query" type="text" name="fname"  required placeholder="输入搜索内容...">
                                        <span class="input-group-btn">
                                            <button class="btn btn-info btn-sm" type="submit">
                                                Search
                                                <i class="icon-search icon-on-right bigger-110"></i>
                                            </button>
                                        </span>
                                    </div>
                                </form>
                            </div>
				</div><!--搜索结束-->

										<div class="table-responsive">
											<table id="sample-table-2" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th class="center">
															<label>
																<input type="checkbox" class="ace" id="check"/>
																<span class="lbl"></span>
															</label>
														</th>
														<th>等级名称</th>
														<th>等级图标</th>

														<th class="hidden-480">所需积分</th>
														<th>会员等级</th>
														<th>操作</th>
													</tr>
												</thead>
												<!--一行的开始-->
												<!--遍历查询到的数据-->
												<foreach name="memlevel" item="v">
			
												<tbody>
													<tr>
														<td class="center">
															<label>
																<input type="checkbox" class="ace" name="box"/>
																<span class="lbl"></span>
															</label>
														</td>

														<td>
															<a href="#">{$v.lname}</a>
														</td>
													
														<td class="hidden-480"><img src="__PUBLIC__/MemlevelUploads/{$v.licon|explode='/',###|implode='/l_',###}" alt=""></td>
														<td>{$v.needscores}</td>
														<td>{$v.llevel}</td>
													

														<td>
															<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
																<a class="blue" href="#">
																	<i class="icon-zoom-in bigger-130"></i>
																</a>

																<a class="green" href="__CONTROLLER__/mod/lid/{$v.lid}">
																	<i class="icon-pencil bigger-130"></i>
																</a>

																<a name="del_{$v.lid}" class="red" data-toggle="modal" href="#deleteModal">
																	<i class="icon-trash bigger-130"></i>
																</a>
															</div>

															<div class="visible-xs visible-sm hidden-md hidden-lg">
																<div class="inline position-relative">
																	<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
																		<i class="icon-caret-down icon-only bigger-120"></i>
																	</button>

																	<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
																		<li>
																			<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
																				<span class="blue">
																					<i class="icon-zoom-in bigger-120"></i>
																				</span>
																			</a>
																		</li>

																		<li>
																			<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
																				<span class="green">
																					<i class="icon-edit bigger-120"></i>
																				</span>
																			</a>
																		</li>


																		<li>
																			<a href="#" class="tooltip-error" title="Delete">
																				<span class="red">
																					<i class="icon-trash bigger-120"></i>
																				</span>
																			</a>
																		</li>
																	</ul>
																</div>
															</div>
														</td>
													</tr>
													<!--遍历结束-->
													</foreach>
													<tr style="height:50px;">
														<td colspan=8>{$page}</td>
													</tr>
													<!--一行的结束-->

													
													</tr>
												</tbody>
											</table>
										</div>
									</div>
								</div>
										</div><!-- /.modal-content -->
									</div><!-- /.modal-dialog -->
								</div><!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					
				

				 <!-- 删除按钮弹出层 -->
                <div class="modal modal-small fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog" style="width:300px;">
                        <div class="modal-content" style="top:160px;left:80%;">
                            <div class="modal-header" style="height:40px;padding:5px 10px;line-height:30px;">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <p class="bigger-120" id="myModalLabel">删除数据</p>
                            </div>
                            <div class="modal-body" style="height:70px;padding:5px 10px;line-height:60px;">
                                <p class="text-danger bigger-150">确定删除数据！</p>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-sm btn-danger" id="delete-data">删除</button>
                                <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div><!-- /.modal -->
                <div id="success-info" class="alert alert-success fade in col-xs-4 hide" style="position:fixed;top:20px;left:35%;z-index:1000;">
				<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
				<strong></strong>
			</div>
			<div id="error-info" class="alert alert-danger fade in col-xs-4 hide" style="position:fixed;top:20px;left:35%;z-index:1000;">
				<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
				<strong></strong>
			</div>
			<!-- 删除按钮弹出层结束 -->
                
                
                
			
								
		</block>
		<block name="privatejs">

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
			jQuery(function($) {

				//设置当前页面的菜单高亮显示 开始
				var nownav = "#sidebar a[href*=Memlevel]";
				var parentattr = $(nownav).parent().parent().attr("class");
				$(nownav).parent().addClass('active');
				if (parentattr == 'submenu') {
					$(nownav).parent().parent().parent().addClass('active open');
				};
				//设置当前页面的菜单高亮显示 结束

				 //全选js
                    $('table th input:checkbox').on('click' , function(){
                        var that = this;
                        $(this).closest('table').find('tr > td:first-child input:checkbox')
                        .each(function(){
                            this.checked = that.checked;
                            $(this).closest('tr').toggleClass('selected');
                        });
                            
                    });                      
                    var delid;
                    var delline;
                    $('a[name^=del]').on('click',function(){
                        delid = ($(this).attr('name').split('_'))[1];
                        delline = $(this).parent().parent().parent();
                    });
                   
                    $('#delete-data').on('click',function(){
                        $.ajax({
                               url:"__CONTROLLER__/del",
                               type:"get",
                               data:{lid:delid},
                               success:function(data){
                                    if (data == 1) {
                                warningInfo("#success-info","删除成功！");
                                location.href='';
                            }else if(data == 2){
                                warningInfo("#error-info","没有删除权限！");
                            }else{
                                warningInfo("#error-info","删除失败！");
                            }
                            $('#deleteModal').modal('hide');
                       }
                });
            });
                   
                   
                   //信息提示函数
            function warningInfo(id,info){
	                $(id).removeClass('hide');
	                $(id).fadeOut(0);
	                $(id).children().eq(1).html(info);
	                $(id).fadeToggle(0).delay(1000).fadeToggle(1000);
            	}
			});
		</script>
</block>

